package com.study.hot.jetpack.livedata;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.lifecycle.ViewModelProvider;

import com.study.hot.R;
import com.study.hot.databinding.ActivityScoreBinding;

/**
 * <pre>
 *     author : fauks
 *     time   : 2020/03/29
 *     desc   : ViewModel+Live Data+DataBinding
 * </pre>
 */
public class ScoreActivity extends AppCompatActivity {
    @Override protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityScoreBinding scoreBinding = DataBindingUtil.setContentView(this, R.layout.activity_score);
        ScoreViewModel scoreViewModel = new ViewModelProvider(this).get(ScoreViewModel.class);
        scoreBinding.setModel(scoreViewModel);
        scoreBinding.setLifecycleOwner(this);
    }
}
